{% extends "package/read_base.html" %}
{% import 'macros/form.html' as form %}

{% block primary_content_inner %}
  <h2 class="hide-heading">{{ _('Groups') }}</h2>

  {% if group_dropdown %}
    <form class="add-to-group" method="post">
      <select id="field-add_group" name="group_added" data-module="autocomplete">
        {% for option in group_dropdown %}
          <option value="{{ option[0] }}"> {{ option[1] }}</option>
        {% endfor %}
      </select>
      <button type="submit" class="btn btn-primary" title="{{ _('Associate this group with this dataset') }}">{{ _('Add to group') }}</button>
    </form>
  {% endif %}

  {% if pkg_dict.groups %}
    <form method="post">
      {% snippet 'group/snippets/group_list.html', groups=pkg_dict.groups %}
    </form>
  {% else %}
    <p class="empty">{{ _('There are no groups associated with this dataset') }}</p>
  {% endif %}

{% endblock %}
